using System;
using System.Runtime.Serialization;


namespace Agron.Data.Contracts
{
    /// <summary>
    /// Provides event data for the <c>Agron.Services.Contracts.ISessionEvents.UserJoined</c> callback.
    /// </summary>
    [Serializable]
    [DataContract(Namespace = "http://schemas.udlap.mx/Agron/UserJoinedEventInfo")]
    public class UserJoinedEventArgs : EventArgs
    {
        private bool _isOwner;
        private int _sessionId;
        private DateTime _timeStamp;
        private UserProfile _userProfile;

        /// <summary>
        /// Initializes a new instance of the <see cref="UserJoinedEventArgs"/> class.
        /// </summary>
        public UserJoinedEventArgs() { }

        /// <summary>
        /// Initializes a new instance of the <see cref="UserJoinedEventArgs"/> class with predefined data.
        /// </summary>
        /// <param name="isOwner">if set to <c>true</c> [is owner].</param>
        /// <param name="userProfile">The user profile.</param>
        /// <param name="sessionId">The session id.</param>
        public UserJoinedEventArgs(bool isOwner, UserProfile userProfile, int sessionId)
        {
            this._isOwner = isOwner;
            this._userProfile = userProfile;
            this._sessionId = sessionId;
            this._timeStamp = DateTime.UtcNow;
        }

        /// <summary>
        /// Gets or sets the session id.
        /// </summary>
        /// <value>The session id.</value>
        [DataMember]
        public int SessionId { get { return this._sessionId; } set { this._sessionId = value; } }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is owner.
        /// </summary>
        /// <value><c>true</c> if this instance is owner; otherwise, <c>false</c>.</value>
        [DataMember]
        public bool IsOwner { get { return this._isOwner; } set { this._isOwner = value; } }

        /// <summary>
        /// Gets or sets the time stamp.
        /// </summary>
        /// <value>The time stamp.</value>
        [DataMember]
        public DateTime TimeStamp { get { return this._timeStamp; } set { this._timeStamp = value; } }

        /// <summary>
        /// Gets or sets the user profile.
        /// </summary>
        /// <value>The user profile.</value>
        [DataMember]
        public UserProfile UserProfile { get { return this._userProfile; } set { this._userProfile = value; } }
    }
}
